package org.demo.test.thread._volatile;

public class Singleton {

//    private static final Singleton singleton;
    private static volatile Singleton singleton;

    public static Singleton getInstance(){
        if(singleton == null){
            synchronized (Singleton.class) {
                if(singleton == null) {
                    singleton = new Singleton();
                }
            }
        }
        return singleton;
    }

}
